package class_7;
import java.io.*;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.StreamTokenizer;
import java.util.Arrays;
import java.util.Scanner;


//2
//1 1 1 1 1 1
//1 2 3 4 5 6
//注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
	public static int start;
	public static int length;
	public static int maxLen;
	public static int maxStart;
 public static void main(String[] args) {
     Scanner in = new Scanner(System.in);
     String str = in.nextLine();
     char[] s = str.toCharArray();
     length = 0;
     start = 0;
     maxLen = Integer.MIN_VALUE;
     maxStart = 0;
     boolean startFlag = false;
     for(int i=0;i<s.length;i++) {
    	 if(!(s[i]>='0' && s[i] <= '9')) {
    		 if(length > maxLen) {
    			 maxLen = length;
    			 maxStart = start;
    		 }
    		 length = 0;
    		 startFlag = false;
    		 continue;
    	 }
    	 if(!startFlag) {
    		 start = i;
    		 startFlag = true;
    	 }
    	 //数字字符
    	 length++;
     }
     if(length > maxLen) {
		 maxLen = length;
		 maxStart = start;
	 }
     
     System.out.println(str.substring(maxStart, maxStart+maxLen));
 }
}

class Solution {
    /**
     * 代码中的类名、方法名、参数名已经指定，请勿修改，直接返回方法规定的值即可
     *
     * 判断岛屿数量
     * @param grid char字符型二维数组 
     * @return int整型
     */
	public static int count = 0;
    public static int solve (char[][] grid) {
        // write code here
    	count = 0;
    	for(int i=0;i<grid.length;i++) {
    		for(int j=0;j<grid[0].length;j++) {
    			if(grid[i][j]=='1') {
    				count++;
    				process(grid,i,j);
    			}
    		}
    	}
    	return count;
    }
    
    public static void process(char[][] grid,int i, int j) {
    	if(i < 0 || i >= grid.length || j < 0 || j >= grid[0].length) {
    		return ;
    	}
    	if(grid[i][j] == '1') {
    		grid[i][j] = '2';
    		process(grid,i-1,j);
    		process(grid,i+1,j);
    		process(grid,i,j-1);
    		process(grid,i,j+1);
    	}
    }
    
    public static void main(String[] args) {
    	char[][] grid = {{'1','1','0','0','0'},{'0','1','0','1','1'}
    	,{'0','0','0','1','1'},{'0','0','0','0','0'},{'0','0','1','1','1'}};
    	int ret = solve(grid);
    	System.out.println(ret);
    }

}